<?php

class FeedObserver implements IObserver{
     

    private $registry;
    
    public function __construct() {
        $this->registry = Registry::getInstance();
    }

    public function notify($eventType, $data) {
        switch ($eventType) {
            case 'feed':

                $db = $this->registry->db;
                $db->query("INSERT INTO feed (who, what, callback, date) VALUES ('".$this->registry->user->user_id."','".$data['what']."', '".$data['action']."', '".time()."')");

                break;

            default:
                break;
        }
    }
}
?>
